package com.captain.special.二叉树.简单;

import com.captain.leetcode.TreeNode;

/**
 * Des:
 *
 * @author XL
 * @Date 2022/5/9 21:47
 */
public class 判断根结点是否等于子结点之和2236 {
    public boolean checkTree(TreeNode root) {
        int rVal = root.val;
        int l = root.left.val;
        int r = root.right.val;
        return rVal == (l + r);
    }
}
